//
//  QLMCustomTipView.m
//  Xiaomakuaixiu
//
//  Created by 龚碧容 on 2017/11/10.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "QLMCustomTipView.h"

@implementation QLMCustomTipView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
+ (instancetype)sharedInstance{
     QLMCustomTipView *sharedInstance = nil;
    sharedInstance = [[self alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, 200)];
    sharedInstance.backgroundColor = [UIColor clearColor];
    return sharedInstance;
}

+ (instancetype)sharedInstance:(CGRect)aRect{
    QLMCustomTipView *sharedInstance = nil;
    sharedInstance = [[self alloc] initWithFrame:aRect];
    sharedInstance.backgroundColor = [UIColor clearColor];
    return sharedInstance;
}

- (id)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        UIImageView *aImageView=[[UIImageView alloc] initWithFrame:CGRectMake(kScreen_width/2-105/2, 43, 105, 97)];
        aImageView.image=[UIImage imageNamed:@"noMoreData"];
        [self addSubview:aImageView];
        
        UILabel *bTipLabel=[[UILabel alloc] initWithFrame:CGRectMake(20, 150, kScreen_width-20*2, 20)];
        bTipLabel.font=[UIFont systemFontOfSize:18];
        bTipLabel.textColor=[UIColor darkGrayColor];
        bTipLabel.backgroundColor=[UIColor clearColor];
        bTipLabel.textAlignment=NSTextAlignmentCenter;
        bTipLabel.text=@"暂无数据";
        [self addSubview:bTipLabel];
    }
    return self;
}

- (void)showView{
    [QLMCustomTipView sharedInstance].hidden = NO;
}

- (void)hideView{
    [QLMCustomTipView sharedInstance].hidden = YES;
}

@end
